/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.urbainski.estagio.entidade;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

/**
 *
 * @author Cristian Elder Urbainski
 * @since 11/12/2011
 */
@Entity
@Table(name = "professor")
public class Professor implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id_professor")
    private Integer idProfessor;
    
    @Column(name = "id_endereco")
    private Integer idEndereco;

    @Column(name = "nm_professor")
    private String nmProfessor;

    @Column(name = "ds_email")
    private String dsEmail;

    @Column(name = "ds_telefone")
    private String dsTelefone;

    @Column(name = "tp_situacao")
    private Integer tpSituacao;

    @Column(name = "tp_graduacao")
    private Integer tpGraduacao;

    @Column(name = "dt_nascimento")
    @Temporal(TemporalType.DATE)
    private Date dtNascimento;

    @Column(name = "nr_rg")
    private String nrRg;

    @Column(name = "nr_cpf")
    private String nrCpf;
    
    @Column(name = "tp_professor")
    private Integer tpProfessor;
    
	@Transient
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idProfessor", fetch = FetchType.LAZY)
    private List<Materia> listaMateria;
    
    @Transient
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idCoordenador", fetch = FetchType.LAZY)
    private List<Curso> listaCurso;
    
    @JoinColumn(name = "id_endereco", referencedColumnName = "id_endereco", insertable = false, updatable= false)
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Endereco endereco;

    public Integer getTpProfessor() {
		return tpProfessor;
	}

	public void setTpProfessor(Integer tpProfessor) {
		this.tpProfessor = tpProfessor;
	}
    
    public String getDsEmail() {
        return dsEmail;
    }

    public void setDsEmail(String dsEmail) {
        this.dsEmail = dsEmail;
    }

    public String getDsTelefone() {
        return dsTelefone;
    }

    public void setDsTelefone(String dsTelefone) {
        this.dsTelefone = dsTelefone;
    }

    public Date getDtNascimento() {
        return dtNascimento;
    }

    public void setDtNascimento(Date dtNascimento) {
        this.dtNascimento = dtNascimento;
    }

    public Endereco getEndereco() {
        return endereco;
    }

    public void setEndereco(Endereco endereco) {
        this.endereco = endereco;
    }

    public Integer getIdEndereco() {
        return idEndereco;
    }

    public void setIdEndereco(Integer idEndereco) {
        this.idEndereco = idEndereco;
    }

    public Integer getIdProfessor() {
        return idProfessor;
    }

    public void setIdProfessor(Integer idProfessor) {
        this.idProfessor = idProfessor;
    }

    public List<Curso> getListaCurso() {
        return listaCurso;
    }

    public void setListaCurso(List<Curso> listaCurso) {
        this.listaCurso = listaCurso;
    }

    public List<Materia> getListaMateria() {
        return listaMateria;
    }

    public void setListaMateria(List<Materia> listaMateria) {
        this.listaMateria = listaMateria;
    }

    public String getNmProfessor() {
        return nmProfessor;
    }

    public void setNmProfessor(String nmProfessor) {
        this.nmProfessor = nmProfessor;
    }

    public String getNrCpf() {
        return nrCpf;
    }

    public void setNrCpf(String nrCpf) {
        this.nrCpf = nrCpf;
    }

    public String getNrRg() {
        return nrRg;
    }

    public void setNrRg(String nrRg) {
        this.nrRg = nrRg;
    }

    public Integer getTpGraduacao() {
        return tpGraduacao;
    }

    public void setTpGraduacao(Integer tpGraduacao) {
        this.tpGraduacao = tpGraduacao;
    }

    public Integer getTpSituacao() {
        return tpSituacao;
    }

    public void setTpSituacao(Integer tpSituacao) {
        this.tpSituacao = tpSituacao;
    }

}
